\subsection{\Auto 's display}

Displaying \autos\ was one of the challenges of this project. Our tutor advised us to chose a n existing tool to display \autos, nevertheless, we did not find any acceptable one in accordance with our choice about the programming language (see the technical choices section for more details).\mk

Consequently, we have developed our own display system. The first step was to create a displaying structure for \autos. It was done using an inherited class of \javaclass{Automaton}: \javaclass{DisplayableAutomaton}. A \javaclass{DisplayableAutomaton} is composed of \javaclass{DisplayableState} which  own the coordinates attributes. 
\Autos are displayed in a panel. This is the \javaclass{DrawingPanel} class extending the JPanel class. Most of the  work of display was made in this class, especially concerning \trs\ between \sts.\bk


\subsubsection{The structure}

\paragraph*{The \javaclass{DisplayableState} class}
\indent\ \mk\\
\indent\ This class extends the \javaclass{State} class by adding a couple of coordinates. Another attribute of this class is the original \st\ used to create the displayable \st. It was necessary to add it. Effectively the constructor of the \javaclass{DisplayableState} class copy the original \st\ with the reference to other \st\ attainable by it. But they were the \sts\ of the original \auto\ which are attainable, and not these of the displayable \auto. So, to reconstruct the good path between displayable \sts\ we needed to keep the reference of the original \st\ by following the same path like the original \auto\.\bk

\paragraph*{The \javaclass{DisplayableAutomaton} class}
\indent\ \mk\\
\indent\ This class regroups needed information as to where to display an \auto. The set of displayable \sts of course, but also the space between two \sts\ and the space between the border and the \sts. All of these attributes are parametrisable to let the display flexible. \mk

One of the important issues was to know how to place \sts\ between each other. The choice was made to place them in a square of \sts. For example, 9 \sts\ will be placed like 3 x 3 \sts.\mk

It is in the constructor of this class that we make the reconstruction broached at the previous point.

\subsubsection{The \javaclass{DrawingPanel} class}
\indent\ \mk\\
\indent\ That is in this panel that all \autos\ display is made. It contains all attributes needed to display them : the size of \sts, the colour of different displayed components. They also and of course contain the drawing methods displaying \sts\ and \trs.\sk

\paragraph*{The drawStates method}
\indent\ \mk\\
\indent\ This method was one of the simplest to write. Effectively, it consist only to visit all \sts\ of the displayable \auto\ and draw circles. The only difficulty was to draw inside circles of the initial and the final \st. Because of the drawing of circles is not made from the centre but the top left corner, drawing a smaller circle inside (for the initials or finals \sts) needed to do some calculus to correctly centre the second one.\sk

\paragraph*{The drawTransitions method}
\indent\ \mk\\
\indent\ Drawing correctly \trs\ was really tough. The solution chosen was one of the best that we found. It consist to use quadratic curve instead of line to link two \sts\ together. Effectively, this way, we are able to display two opposed \trs. One difficulty was to know how to draw reflexive \trs. It was made to use quadratic curve again starting from one side of a \st\ and finishing on the other. \mk

We have considered to drawing arrows on the \trs, however it  was too complicated and too time-eater. So we decided to simply display in the \trs\ label the two \sts\ implicated in the relation.\bk



